// const { defineConfig } = require('@vue/cli-service')
// module.exports = defineConfig({
//   transpileDependencies: true,
// })
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
    // transpileDependencies:true,
    transpileDependencies:['simple-mind-map'],

    chainWebpack: config => {
        config.plugin('copy').use(CopyWebpackPlugin, [
            {
                patterns: [
                    {
                        from: 'src/components/markdown/*.md', // 适配你的 Markdown 文件存放路径
                        to: 'src/components/markdownoutput', // 修改为你期望的输出路径
                        force: true,
                    },
                ],
            },
        ]),
        config.module
            .rule('markdown')
            .test(/\.md$/)
            .use('vue-loader')
            .loader('vue-loader')
            .end()
            .use('vue-markdown-loader')
            .loader('vue-markdown-loader/lib/markdown-compiler')
            .options({
                raw: true
            });
        config.module
            .rule('tsx')
            .test(/\.tsx?$/)
            .use('ts-loader')
            .options({
                appendTsSuffixTo:[/\.vue$/],
            })
            .tap(options =>{
                return options
            })
        config.module
            .rule('js')
            .use('babel-loader')
    }
};

